﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Agile.Engine.View;
using System.Collections;
using Agile.Engine;
using Agile.Engine.Data;

namespace Fis.Win.Rules
{
    public class AidsListViewProvider : ClientViewProvider
    {
        public override Hashtable InitializeViewModel(Hashtable args)
        {
            var model = base.InitializeViewModel(args);
            return model;
        }

        public override bool ExecuteUpdate(Hashtable viewModel)
        {

            var param = Fis.Win.Utils.AppSession.CreateServiceParamter(new Hashtable());
            param["Action"] = "Delete";
            param["SID"] = viewModel["SID"];
            var exec = InvokeService(param);

            if (exec)
            {
                var sid = viewModel["SID"].ToString();
                DataAccess a = new DataAccess() { Context = DataContext, TableName = DataTableName };
                a.Delete(sid);
            }
            return exec;
        }
    }
}
